package com.hd.manager.util;

import com.alibaba.fastjson.JSONObject;
import com.hd.appcommon.utils.ICallBack;
import org.springframework.stereotype.Component;

import java.util.concurrent.ConcurrentHashMap;

/**
 * @projectName:    entrance_guard 
 * @package:        com.hd.appcommon.utils
 * @className:      CallBackUtil
 * @author:     otto
 * @description:  
 * @date:    2023/8/1 16:20
 * @version:    1.0
 */ 

@Component
public class CallBackUtil {
    private static ConcurrentHashMap<Long, ICallBack> callBackMap = new ConcurrentHashMap<>();
    public static ConcurrentHashMap<Long,ICallBack> getCallBackMap(){
        return callBackMap;
    }

    public void sendForBlock(Long requestId, ICallBack callBack){
        callBackMap.put(requestId,callBack);
    }
}
